﻿using System;

namespace DuckFlyWithInterface
{
    /// <summary>
    /// 鸭子叫声行为的接口
    /// </summary>
    interface IQuackBehavior
    {
        public void Quack();
    }

    /// <summary>
    /// 正常嘎嘎叫的实现
    /// </summary>
    public class NormalQuack : IQuackBehavior
    {
        public void Quack()
        {
            Console.WriteLine("嘎嘎嘎！");
        }
    }

    /// <summary>
    /// 吱吱叫的实现（如橡皮鸭）
    /// </summary>
    public class Squeak : IQuackBehavior
    {
        public void Quack()
        {
            Console.WriteLine("吱吱吱！");
        }
    }

    /// <summary>
    /// 不会叫的实现（如木头鸭）
    /// </summary>
    public class MuteQuack : IQuackBehavior
    {
        public void Quack()
        {
            Console.WriteLine("（沉默中，不会叫）");
        }
    }

    /// <summary>
    /// 大声叫的实现
    /// </summary>
    public class LoudQuack : IQuackBehavior
    {
        public void Quack()
        {
            Console.WriteLine("嘎嘎嘎！（声音特别大）");
        }
    }
}
